<template>
  <BaseContainer>
    <aplid-base-crud ref="crud" class="w-100" v-bind="baseConfig">
      <template v-slot:addDialog="{ row, show }">
        <OperateForm v-if="show" :nowRowData="row" @refresh="handleRefresh"></OperateForm>
      </template>
      <template v-slot:editDialog="{ row, show }">
        <OperateForm v-if="show" :nowRowData="row"  @refresh="handleRefresh"></OperateForm>
      </template>
      <template v-slot:previewDialog="{ row, show }">
        <preview v-if="show" @refresh="handleRefresh" :moudleName="row.moudleName"></preview>
      </template>
    </aplid-base-crud>
  </BaseContainer>
</template>

<script setup>
import {baseConfig} from './config'
import OperateForm from './operate/index.vue'
import preview from './preview/index.vue'

const crud = ref(null)
const handleRefresh = () => {
	nextTick(() => {
		crud.value?.refreshChange()
	})
}

</script>

<style lang="scss" scoped></style>
